﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="employee.aspx.vb" Inherits="GLOBALDATABASE.WebForm3" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" runat="server" contentplaceholderid="MainContent">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="emp_id" DataSourceID="SqlDataSource1">
        <Columns>
            <asp:BoundField DataField="emp_id" HeaderText="emp_id" ReadOnly="True" 
                SortExpression="emp_id" />
            <asp:BoundField DataField="fname" HeaderText="fname" SortExpression="fname" />
            <asp:BoundField DataField="minit" HeaderText="minit" SortExpression="minit" />
            <asp:BoundField DataField="lname" HeaderText="lname" SortExpression="lname" />
            <asp:BoundField DataField="job_id" HeaderText="job_id" 
                SortExpression="job_id" />
            <asp:BoundField DataField="job_lvl" HeaderText="job_lvl" 
                SortExpression="job_lvl" />
            <asp:BoundField DataField="pub_id" HeaderText="pub_id" 
                SortExpression="pub_id" />
            <asp:BoundField DataField="hire_date" HeaderText="hire_date" 
                SortExpression="hire_date" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:pubsConnectionString13 %>" 
        DeleteCommand="DELETE FROM [employee] WHERE [emp_id] = @emp_id" 
        InsertCommand="INSERT INTO [employee] ([emp_id], [fname], [minit], [lname], [job_id], [job_lvl], [pub_id], [hire_date]) VALUES (@emp_id, @fname, @minit, @lname, @job_id, @job_lvl, @pub_id, @hire_date)" 
        SelectCommand="SELECT * FROM [employee]" 
        UpdateCommand="UPDATE [employee] SET [fname] = @fname, [minit] = @minit, [lname] = @lname, [job_id] = @job_id, [job_lvl] = @job_lvl, [pub_id] = @pub_id, [hire_date] = @hire_date WHERE [emp_id] = @emp_id">
        <DeleteParameters>
            <asp:Parameter Name="emp_id" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="emp_id" Type="String" />
            <asp:Parameter Name="fname" Type="String" />
            <asp:Parameter Name="minit" Type="String" />
            <asp:Parameter Name="lname" Type="String" />
            <asp:Parameter Name="job_id" Type="Int16" />
            <asp:Parameter Name="job_lvl" Type="Byte" />
            <asp:Parameter Name="pub_id" Type="String" />
            <asp:Parameter Name="hire_date" Type="DateTime" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="fname" Type="String" />
            <asp:Parameter Name="minit" Type="String" />
            <asp:Parameter Name="lname" Type="String" />
            <asp:Parameter Name="job_id" Type="Int16" />
            <asp:Parameter Name="job_lvl" Type="Byte" />
            <asp:Parameter Name="pub_id" Type="String" />
            <asp:Parameter Name="hire_date" Type="DateTime" />
            <asp:Parameter Name="emp_id" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
</asp:Content>

